require("../../assets/css/normalize.css");
require("../../assets/css/reset.css");
require("../../assets/fonts/iconfont.css");
require("../../assets/css/navbar.less");
require("../../assets/css/tabbar.less");
require("./movement_cycling.less");

// 引入模块
let axios = require("../../utils/axios.js");
let doc = require("../../utils/dom");
let getHMS = require("../../utils/getHMS.js");

document.addEventListener("DOMContentLoaded", function () {
	doc.tabbar("tabbar");
    doc.navbar('movement_cycling');

    // 蒙层倒计时
	doc.get(".go").addEventListener("click", () => {
		doc.get("#mask").style.display = "block";
		let n = 3;
		setInterval(() => {
			n--;
			if (n < 0) {
				this.location.href = "movement_cyclinging.html";
			} else {
				doc.get("#mask").textContent = n;
			}
		}, 1000);
	});

	axios.get("/api/exercise").then((res) => {
		if (res.data.errno === 0) {
            doc.get('strong').textContent = res.data.data.sum7Meter
		}else{
            alert('获取数据失败')
        }
	});
})